//#include "TcpServer.hpp"
#include <string>
#include <iostream>
#include <memory>
#include "HttpServer.hpp"
//#include <ctime>
#include "log.hpp"

static void  Usage(std::string proc)
{
  std::cout << "Usage:\n\t" << proc << "\tport" << std::endl;
}

int main(int argc, char *argv[])
{
  //std::cout<<time(nullptr)<<std::endl;
  //LOG(INFO, "deBUG project");
  
 if(argc != 2)
 {
   Usage(argv[0]);
   exit(4);
 }
 //std::cout<<"hello HTTP"<<std::endl;
 int port = atoi(argv[1]);
 //TcpServer *svr = TcpServer::getinstance(port);

 std::shared_ptr<HttpServer> http_server(new HttpServer(port));

 http_server->InitServer();
 http_server->Loop();

  return 0;
}
